package com.ideyatech.errorhandling.web.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.BeansException;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.AbstractController;

import com.ideyatech.errorhandling.service.InitService;

public class LoginController extends AbstractController {
    private String viewName;

    private InitService initService;
    
    @Override
    protected void initApplicationContext() throws BeansException {
	super.initApplicationContext();
        initService.init();
    }

    @Override
    protected ModelAndView handleRequestInternal(HttpServletRequest request,
	    HttpServletResponse response) throws Exception {
	// TODO Auto-generated method stub
	return new ModelAndView(getViewName());
    }

    public void setViewName(String viewName) {
	this.viewName = viewName;
    }

    public String getViewName() {
	return viewName;
    }

    public InitService getInitService() {
	return initService;
    }

    public void setInitService(InitService initService) {
	this.initService = initService;
    }

}
